home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- // dynIntMinMax.mel
- // This proc contains utility routines needed by various files.
- //
-
- //----------------------- dynIntMinMax ------------------------------
- //
- // Set the new control value in the context and adjust the intSliderGrp
- // range if the user has gone beyond the current slider min/mix.
- //
- global proc dynIntMinMax(string $toolName,
- string $contextName,
- string $controlName,
- string $flag,
- int $fieldMin, int $fieldMax)
- {
-
- // If the user has typed in a number greater than the current
- // slider range, adjust the slider range to go from 0 to twice
- // the new value.
- //
-
- // Get the new value typed in, and the current max and min.
- //
- int $newValue = `intSliderGrp -q -v $controlName`;
- int $currMaxValue = `intSliderGrp -q -max $controlName`;
- int $currMinValue = `intSliderGrp -q -min $controlName`;
-
- // Set the new value in the context.
- //
- eval($contextName+" -e "+$flag+" "+$newValue+" "+$toolName);
-
-
- if ($newValue < $currMinValue)
- {
- // If the new new value is less than the current minimum,
- // set the max value to 0, and the min value to newValue * 2
- //
- int $newMax = 0.0;
- int $newMin = $newValue * 2;
- intSliderGrp -e
- -min $newMin -fmn $fieldMin
- -max $newMax -fmx $fieldMax
- -step 1
- $controlName;
- }
- else if ($newValue > $currMaxValue)
- {
- // If the new new value is greater than the current maximum,
- // set the min value to 0 and the max value to newValue * 2
- //
- int $newMin = 0.0;
- int $newMax = $newValue * 2;
- intSliderGrp -e
- -min $newMin -fmn $fieldMin
- -max $newMax -fmx $fieldMax
- -step 1
- $controlName;
- }
- }
-
-